var vm = new Vue({
	el: '#rrapp',
	data: {
		showList: true,
		title: null,
		taskAll: {
			//办结时间不足5天
			lessFive: '0',
			//已超期件数
			overTime: '0',
			//待办总数
			waitingAll: '0',
			//已办总数
			completeAll: '0'
		},
		taskByMonth: {
			//新增数
			increaseNums: '0',
			//已办理数
			answeredNums: '0',
			//正在办理数
			dealingNums: '0'

		},
		//群众满意度
		satisfaction: []

	},
	methods: {
		//总数统计
		taskAllMethod: function() {
			$.ajax({
				type: "GET",
				url: baseURL + "main/taskAll",
				contentType: "application/json",
				success: function(r) {
					if(r.code === 0) {
						//办结时间不足5天
						vm.taskAll.lessFive = r.lessFive;
						//已超期件数
						vm.taskAll.overTime = r.overTime;
						//待办总数
						vm.taskAll.waitingAll = r.waitingAll;
						//已办总数
						vm.taskAll.completeAll = r.completeAll;
					} else {
						alert(r.msg);
					}
				}
			});

		},
		//月统计
		taskByMonthMethod: function() {
			$.ajax({
				type: "GET",
				url: baseURL + "main/taskByMonth",
				contentType: "application/json",
				success: function(r) {
					if(r.code === 0) {
						//新增数
						vm.taskByMonth.increaseNums = r.increaseNums;
						//已办理数
						vm.taskByMonth.answeredNums = r.answeredNums;
						//正在办理数
						vm.taskByMonth.dealingNums = r.dealingNums;
					} else {
						alert(r.msg);
					}
				}
			});

		},
		//群众满意度
		satisfactionMethod: function() {
			vm.ajax_GET("main/satisfaction", 'echart_satisfaction');
		},
		//人口流动
		populationMethod: function() {
			vm.ajax_GET("main/population", 'echart_population');
		},
		//贫困情况
		povertyMethod: function() {
			$.ajax({
				type: "GET",
				url: baseURL + "main/poverty",
				contentType: "application/json",
				success: function(r) {
					if(r.code === 0) {
						poverty(r.series_data_one, r.series_data_two);
					} else {
						alert(r.msg);
					}
				}
			});

		},
		//年龄状态
		ageMethod: function() {
			vm.ajax_GET("main/age", 'echart_age');
		},
		//学历
		educationMethod: function() {
			$.ajax({
				type: "GET",
				url: baseURL + "main/education",
				contentType: "application/json",
				success: function(r) {
					if(r.code === 0) {
						education(r.xAxis_data, r.series_data);
					} else {
						alert(r.msg);
					}
				}
			});

		},
		//婚姻状态
		marryMethod: function() {
			vm.ajax_GET("main/marry", 'echart_marry');
		},
		//男女比例
		sexMethod: function() {
			vm.ajax_GET("main/sex", 'echart_sex');
		},
		ajax_GET: function(url, div_id) {
			$.ajax({
				type: "GET",
				url: baseURL + url,
				contentType: "application/json",
				success: function(r) {
					if(r.code === 0) {
						myChart(div_id, r.data);
					} else {
						alert(r.msg);
					}
				}
			});
		}
	}
});